{layout name="/base" /}
<!--地图插件-->
<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=a7e2fc1a96a83283106bf583328aa248&plugin=AMap.Autocomplete"></script>
<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
<!--地图插件结束-->
<!--载入百度编辑器所需js文件-->
<script type="text/javascript" charset="utf-8" src="/UEditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/UEditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/UEditor/lang/zh-cn/zh-cn.js"></script>
<!--百度编辑器-->
<div class="row">
	<div class="col-lg-12">
		<h1>营地管理 <small>营地信息编辑</small></h1>
		<ol class="breadcrumb">
			<li><a href="/index"><i class="fa fa-dashboard"></i> 管理首页</a></li>
			<li><a href="/camps"><i class="fa fa-dashboard"></i> 营地列表信息</a></li>
			<li class="active"><i class="fa fa-table"></i> 营地信息编辑</li>
		</ol>
		<div class="alert alert-success alert-dismissable">
			<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> 请准确编辑营地信息
		</div>
	</div>
</div>
<!-- /.row -->
<div class="row">
	<!-- 选项卡start -->
	<div class="bs-example">
		<!-- 选项卡标题start -->
		<ul class="nav nav-tabs" style="margin-bottom:15px;">
			<li class="active">
				<a href="#one" data-toggle="tab">营地基本信息</a>
			</li>
			<li>
				<a href="#two" data-toggle="tab">营地介绍图文信息</a>
			</li>
		</ul>
		<!-- 选项卡标题end -->
		<form class="form-horizontal" role="form" action="/camps" method="post" enctype="multipart/form-data">
		<!-- 选项卡内容start -->
		<div id="myTabContent" class="tab-content">
			<!-- 选项卡内容1会员类型start -->
			<div id="one" class="tab-pane fade active in">
				<!-- 基本信息start -->
				<div class="col-lg-11">
					<!-- 营地信息start -->
						<div class="form-group">
							<label class="control-label col-sm-2">营地编号</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="number" value="" placeholder="sjz85468585">
							</div>
							<label class="control-label col-sm-2">营地名称</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="name" value="" placeholder="请填写营地名称">
							</div>
						</div>
						<div class="form-group ">
							<label for="firstname" class="control-label col-sm-2">营地类型</label>
							<div class="col-sm-4">
								<select class="form-control" name="type">
			                      {foreach $types as $k => $type}
			                       	<option value={$k}>{$type}</option>
			                      {/foreach}
		                      </select>
							</div>
							<label for="firstname" class="control-label col-sm-2">营地星级</label>
							<div class="col-sm-4">
								<select class="form-control" name="grade">
			                      {foreach $grades as $k => $grade}
			                       <option value={$k} >{$grade}</option>
			                       {/if}
			                      {/foreach}
	                    		</select>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2">泊位数量</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="count" value="" placeholder="请填写泊位数量">
							</div>
							<label class="control-label col-sm-2">营地描述</label>
							<div class="col-sm-4">
								<textarea class="form-control" type="text" name="profiles" value="" placeholder="请填写营地名称"> </textarea>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2">管理员账号</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="campmanager_phone" value="" placeholder="请填写手机号码" />
							</div>
							<label class="control-label col-sm-2">负责人姓名</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="campmanager_name" value="" placeholder="请填写负责人姓名">
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2">联系电话</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="tel" value="" placeholder="请填写其他联系电话" />
							</div>
							<label class="control-label col-sm-2">营地分公司</label>
							<div class="col-sm-4">
								<select class="form-control" name="branch">
			                      {foreach $trees as $k => $tree}
			                       <option value={$k} >{$tree}</option>
			                       {/if}
			                      {/foreach}
			                    </select>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2">邮箱</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="email" value="" placeholder="请填写营地负责人邮箱" />
							</div>
							<label class="control-label col-sm-2">营地旅行币基数</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="travel_money_base" value="" placeholder="" />
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2">法人代表</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="legal_person" value="" placeholder="请填写营地负责人邮箱" />
							</div>
							<label class="control-label col-sm-2">统一社会信用代码</label>
							<div class="col-sm-4">
								<input class="form-control" type="text" name="credit_code" value="" placeholder="请填写" />
							</div>
						</div>
						<div class="form-group" id="global_location">
							<label class="control-label col-sm-2">地址</label>
							<select name="country" class="country" data-first-title="选择国家" style="width:100px;"></select>
					        <select name="state" class="state" style="width:100px;" data-required="true"></select>
					        <select name="city" class="city" style="width:100px;" data-required="true"></select>
						</div>
					
						<div class="form-group">
							<label for="firstname" class="control-label col-sm-2">营地封面</label>
							<div class="col-sm-10">
								<input type="file" id="cover" name="cover" />
							</div>
						</div>
						
						<div class="form-group">
							<label for="firstname" class="control-label col-sm-2">营业执照</label>
							<div class="col-sm-10">
								<input type="file" id="license" name="license" />
							</div>
						</div>
						
						<!-- 地图start -->
						<div class="form-group">
							<label for="firstname" class="control-label col-sm-2">营地地图</label>
							<div class="col-sm-10 campmap">
								<div id="container"></div>
								<div id="myPageTop">
									<table>
										<tr>
											<td>
												<label>按关键字搜索：</label>
											</td>
											<td class="column2">
												<label>左击获取经纬度：</label>
											</td>
										</tr>
										<tr>
											<td>
												<input type="text" placeholder="请输入关键字进行搜索" id="tipinput">
											</td>
											<td class="column2">
												<input type="text" readonly="true" id="lnglat">
												<input type="text" name="lng" id='lng' value='' />
												<input type="text" name="lat" id='lat' value='' />
											</td>
										</tr>
									</table>
								</div>
								<script type="text/javascript">
									var map = new AMap.Map("container", {
										resizeEnable: true,
										zoom: 15
									});
									var marker = new AMap.Marker({
										draggable: true,
										cursor: 'move',
										raiseOnDrag: true
									});
									marker.setMap(map);
									//为地图注册click事件获取鼠标点击出的经纬度坐标
									var clickEventListener = map.on('click', function(e) {
										document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat();
										document.getElementById("lng").value = e.lnglat.getLng();
										document.getElementById("lat").value = e.lnglat.getLat();
										marker.setPosition([e.lnglat.getLng(), e.lnglat.getLat()])
									});
									var auto = new AMap.Autocomplete({
										input: "tipinput"
									});
									AMap.event.addListener(auto, "select", select); //注册监听，当选中某条记录时会触发
									function select(e) {
										if (e.poi && e.poi.location) {
											map.setZoom(15);
											map.setCenter(e.poi.location);
											document.getElementById("lnglat").value = e.poi.location.getLng() + ',' + e.poi.location.getLat();
											document.getElementById("lng").value = e.poi.location.getLng();
											document.getElementById("lat").value = e.poi.location.getLat();
											marker.setPosition([e.poi.location.getLng(), e.poi.location.getLat()])
										}
									}
								</script>
							</div>
						</div>
						<div class="form-group">
							<div class="btn-group mybtn col-sm-4 col-sm-offset-2">
								<a href="#two" data-toggle="tab" class="btn btn-primary">下一步</a>
							</div>
						</div>
						<!-- 营地信息end -->
				</div>
				<!-- 基本信息end -->
			</div>
			<!-- 选项卡内容1营地基本信息end -->
			<!-- 选项卡内容2营地图文信息start -->
			<div id="two" class="tab-pane fade">
				<!-- 基本信息start -->
				<div class="col-lg-12">
					<div class="form-group">
						<!--调用百度编辑器开始-->
						<script id="editor" type="text/plain" style="width:100%;height:500px;" name="content"></script>
						<script>
					        
					        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
						    UE.Editor.prototype.getActionUrl = function(action) {
						        if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
						            return 'http://tp5.local/uploadimg';
						        } else if (action == 'uploadvideo') {
						            return 'http://a.b.com/video.php';
						        } else {
						            return this._bkGetActionUrl.call(this, action);
						        }
						    }
						
						    var ue = UE.getEditor('editor',{toolbars: [[
						            'fullscreen', 'source', '|', 'undo', 'redo', '|',
						            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
						            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
						            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
						            'directionalityltr', 'directionalityrtl', 'indent', '|',
						            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
						            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
						            'simpleupload', 'insertimage', 'emotion', 'map', 'gmap', 'insertframe', 'insertcode', 'background', '|',
						            'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
						            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
						            'print', 'preview', 'searchreplace', 'drafts', 'help'
						        ]]});
						    ue.addListener('ready', function() {
						        ue.focus();
						    });
					    </script>
					    <!--调用百度编辑器结束-->
					</div>
					
					<div class="form-group">
						<div class="btn-group mybtn">
							<a href="#one" class="btn btn-link">上一步</a>
							<button class="btn btn-primary" type="submit">提交</button>
						</div>
					</div>
				</div>
				<!-- 基本信息end -->
			</div>
			<!-- 选项卡内容2营地图文信息end -->
		</div>
		<!-- 选项卡内容end -->
		</form>
	</div>
	<!-- 选项卡end -->
</div>

<!--城市插件-->
<script type="text/javascript">
//城市插件
	$.cxSelect.defaults.url = '/static/js/cityData.json';
	$.cxSelect.defaults.emptyStyle = 'none';
	$('#global_location').cxSelect({
		url: '/static/js/globalData.json', // 如果服务器不支持 .json 类型文件，请将文件改为 .js 文件
		selects: ['country', 'state', 'city'], // 数组，请注意顺序
		emptyStyle: 'none'
	});
</script>

























 

